package com.iplant.basic.service.po.bms;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import com.iplant.base.po.BaseUser;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;;

@DBBasePO(TableName = "mbs_user", Code = false, CheckName = {"LoginName"}, Cache = true, AllowDeleteTable = true)
public class BMSEmployee extends BaseUser implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    public static BMSEmployee SysAdmin = new BMSEmployee();

    static {
        SysAdmin.ID = BaseUser.SysAdmin.ID;
        SysAdmin.Grad = BaseUser.SysAdmin.Grad;
        SysAdmin.Name = BaseUser.SysAdmin.Name;
        SysAdmin.LoginName = BaseUser.SysAdmin.LoginName;
        SysAdmin.Password = BaseUser.SysAdmin.Password;
    }

    @DBJoin(name = "Name", tableName = "mbs_user", tableAsName = "u1", Schemas = DBSchemas.Basic, MainTableField =
            "CreatorID")
    public String CreatorName = "";


    @DBJoin(name = "Name", tableName = "mbs_user", tableAsName = "u2", Schemas = DBSchemas.Basic, MainTableField =
            "EditorID")
    public String EditorName = "";


    @DBCondition
    @DBField
    public int DepartmentID;

    public String Department = "";
    @DBField
    public int Manager = 0;
    @DBField
    public String Phone = "";
    @DBField
    public String Email = "";
    @DBField
    public int Position;

    public String PositionName = "";
    @DBField
    public String WeiXin = "";
    @DBField
    public long PhoneMAC;
    @DBField
    public int Online;
    @DBField
    public int Type = 0;

    public int OnShift;

    /**
     * 直接上级ID 根据岗位的DutyID自动设置 规则为自动设置条件
     */
    @DBField
    public int SuperiorID = 0;
    @DBField
    public Calendar OnLineTime = Calendar.getInstance();
    @DBField
    public Calendar DepartureDate = Calendar.getInstance();
    @DBField
    public Calendar LastOnLineTime = Calendar.getInstance();

    @DBCondition
    @DBField
    public String LoginID;
    @DBField
    public int DutyID;

    public List<Integer> RoleIDList = new ArrayList<Integer>();

    public String RoleCode = "";

    public String RoleName = "";
    @DBField
    public String FaceIcon = "";

    public BMSEmployee() {
        this.ID = -1;
        this.OnLineTime.set(2000, 0, 1);
        this.DepartureDate.set(2000, 0, 1);
        this.LastOnLineTime.set(2000, 0, 1);
    }

    @Override
    @JsonProperty("CreatorName")
    public String getCreatorName() {
        return CreatorName;
    }

    @Override
    public void setCreatorName(String creatorName) {
        CreatorName = creatorName;
    }

    @Override
    @JsonProperty("EditorName")
    public String getEditorName() {
        return EditorName;
    }

    @Override
    public void setEditorName(String editorName) {
        EditorName = editorName;
    }

    @JsonProperty("RoleIDList")
    public List<Integer> getRoleIDList() {
        return RoleIDList;
    }

    public void setRoleIDList(List<Integer> roleIDList) {
        RoleIDList = roleIDList;
    }

    @JsonProperty("PositionName")
    public String getPositionName() {
        return PositionName;
    }

    public void setPositionName(String positionName) {
        PositionName = positionName;
    }

    @JsonProperty("Type")
    public int getType() {
        return Type;
    }

    public void setType(int type) {
        Type = type;
    }

    @JsonProperty("DepartmentID")
    public int getDepartmentID() {
        return DepartmentID;
    }

    public void setDepartmentID(int departmentID) {
        DepartmentID = departmentID;
    }

    @JsonProperty("Department")
    public String getDepartment() {
        return Department;
    }

    public void setDepartment(String department) {
        Department = department;
    }

    @JsonProperty("Manager")
    public int getManager() {
        return Manager;
    }

    public void setManager(int manager) {
        Manager = manager;
    }

    @JsonProperty("Phone")
    public String getPhone() {
        return Phone;
    }

    public void setPhone(String phone) {
        Phone = phone;
    }

    @JsonProperty("Email")
    public String getEmail() {
        return Email;
    }

    public void setEmail(String email) {
        Email = email;
    }

    @JsonProperty("Position")
    public int getPosition() {
        return Position;
    }

    public void setPosition(int position) {
        Position = position;
    }

    @JsonProperty("WeiXin")
    public String getWeiXin() {
        return WeiXin;
    }

    public void setWeiXin(String weiXin) {
        WeiXin = weiXin;
    }

    @JsonProperty("PhoneMAC")
    public long getPhoneMAC() {
        return PhoneMAC;
    }

    public void setPhoneMAC(long phoneMAC) {
        PhoneMAC = phoneMAC;
    }

    @JsonProperty("Online")
    public int getOnline() {
        return Online;
    }

    public void setOnline(int online) {
        Online = online;
    }

    @JsonProperty("OnShift")
    public int getOnShift() {
        return OnShift;
    }

    public void setOnShift(int onShift) {
        OnShift = onShift;
    }

    @JsonProperty("SuperiorID")
    public int getSuperiorID() {
        return SuperiorID;
    }

    public void setSuperiorID(int superiorID) {
        SuperiorID = superiorID;
    }

    @JsonProperty("OnLineTime")
    public Calendar getOnLineTime() {
        return OnLineTime;
    }

    public void setOnLineTime(Calendar onLineTime) {
        OnLineTime = onLineTime;
    }

    @JsonProperty("DepartureDate")
    public Calendar getDepartureDate() {
        return DepartureDate;
    }

    public void setDepartureDate(Calendar departureDate) {
        DepartureDate = departureDate;
    }

    @JsonProperty("LastOnLineTime")
    public Calendar getLastOnLineTime() {
        return LastOnLineTime;
    }

    public void setLastOnLineTime(Calendar lastOnLineTime) {
        LastOnLineTime = lastOnLineTime;
    }

    @JsonProperty("LoginID")
    public String getLoginID() {
        return LoginID;
    }

    public void setLoginID(String loginID) {
        LoginID = loginID;
    }

    @JsonProperty("DutyID")
    public int getDutyID() {
        return DutyID;
    }

    public void setDutyID(int dutyID) {
        DutyID = dutyID;
    }

    @JsonProperty("RoleCode")
    public String getRoleCode() {
        return RoleCode;
    }

    public void setRoleCode(String roleCode) {
        RoleCode = roleCode;
    }

    @JsonProperty("RoleName")
    public String getRoleName() {
        return RoleName;
    }

    public void setRoleName(String roleName) {
        RoleName = roleName;
    }

    public static BMSEmployee getSysAdmin() {
        return SysAdmin;
    }

    public static void setSysAdmin(BMSEmployee sysAdmin) {
        SysAdmin = sysAdmin;
    }

    @JsonProperty("FaceIcon")
    public String getFaceIcon() {
        return FaceIcon;
    }

    public void setFaceIcon(String faceIcon) {
        FaceIcon = faceIcon;
    }
}
